package com.androidy;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;


public class aboutme extends Activity implements OnClickListener{
	ImageView timeline, tl1, tl2, tl3, tl4, tl5;
	Button back;
		
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.about);
		TextView header = (TextView)this.findViewById(R.id.header);
		header.setText("About me");
		LinearLayout head_layout = (LinearLayout)this.findViewById(R.id.natvigation);
		head_layout.setBackgroundResource(R.drawable.green);
		back = (Button)this.findViewById(R.id.back);
		back.setText("back");
		
		timeline = (ImageView)this.findViewById(R.id.timeline_arrow);
		tl1 = (ImageView)this.findViewById(R.id.timeline_1);
		tl2 = (ImageView)this.findViewById(R.id.timeline_2);
		tl3 = (ImageView)this.findViewById(R.id.timeline_3);
		tl4 = (ImageView)this.findViewById(R.id.timeline_4);
	
		back.setOnClickListener(this);
		tl1.setOnClickListener(this);
		tl2.setOnClickListener(this);
		tl3.setOnClickListener(this);
		tl4.setOnClickListener(this);
    }
        
    public void timeline_animation(){
	    custAnimationListener cAL1 = new custAnimationListener("transform", 500, 0, 0, -800, 0, 0);
	    cAL1.startAnimation(timeline, true);
	    custAnimationListener cAL2 = new custAnimationListener("transform", 500, 100, -200, 0, 0, 0);
	    cAL2.startAnimation(tl1, true);
	    custAnimationListener cAL3 = new custAnimationListener("transform", 500, 200, 200, 0, 0, 0);
	    cAL3.startAnimation(tl2, true);
	    custAnimationListener cAL4 = new custAnimationListener("transform", 500, 300, -200, 0, 0, 0);
	    cAL4.startAnimation(tl3, true);
	    custAnimationListener cAL5 = new custAnimationListener("transform", 500, 400, 200, 0, 0, 0);
	    cAL5.startAnimation(tl4, true);
    }

    public void timeline_animation(Intent i){
	    custAnimationListener cAL1 = new custAnimationListener("transform", 500, 0, 0, 0, 0, 800);
	    cAL1.startAnimation(timeline, false);
	    custAnimationListener cAL2 = new custAnimationListener("transform", 500, 100, 0, 0, -200, 0);
	    cAL2.startAnimation(tl1, false);
	    custAnimationListener cAL3 = new custAnimationListener("transform", 500, 200, 0, 0, 200, 0);
	    cAL3.startAnimation(tl2, false);
	    custAnimationListener cAL4 = new custAnimationListener("transform", 500, 300, 0, 0, -200, 0);
	    cAL4.startAnimation(tl3, false);
	    custAnimationListener cAL5 = new custAnimationListener("transform", 500, 400, 0, 0, 200, 0);
	    cAL5.startAnimation(tl4, false, i, this);
    }
    
    public void onResume(){
    	super.onResume();
		timeline_animation();
    }

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		if (v == back)
			this.finish();
		else if (v == tl1)
			timeline_animation(new Intent(this, year1986.class));
		else if (v == tl2)
			timeline_animation(new Intent(this, year2000.class));
		else if (v == tl3)
			timeline_animation(new Intent(this, year2010.class));
		else if (v == tl4)
			timeline_animation(new Intent(this, year2012.class));
	}
    
/*

	*/
}
